package com.heima.admin.feign;

import com.heima.apis.wemedia.IWmChannel;
import com.heima.model.admin.dtos.AdChannelDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.NewsAuthDto;
import com.heima.model.wemedia.dtos.SensitiveDto;
import com.heima.model.wemedia.pojos.WmChannel;
import com.heima.model.wemedia.pojos.WmSensitive;
import com.heima.model.wemedia.pojos.WmUser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@Slf4j
public class WmChannelClient implements IWmChannel {

@Resource
private IWmChannel iWemediaClient;
@Override
@PostMapping("/api/v1/channel/list") //分页查询
public ResponseResult findAll(@RequestBody AdChannelDto dto) {
    return iWemediaClient.findAll(dto);
}

    @Override
    @PostMapping("/api/v1/channel/update")
    public ResponseResult updateChannel(WmChannel wmChannel) {
        return iWemediaClient.updateChannel(wmChannel);
    }

    @Override
    @PostMapping("/api/v1/channel/save")
    public ResponseResult saveChannel(WmChannel wmChannel){
    return iWemediaClient.saveChannel(wmChannel);
    }

    @Override
    @GetMapping ("/api/v1/channel/del/{id}")
    public ResponseResult deleteChannel(@PathVariable("id") Integer id ) {
        return iWemediaClient.deleteChannel(id);
    }


    @Override
    @PostMapping("/api/v1/news/list_vo")
    public ResponseResult listVo(NewsAuthDto dto) {
        return iWemediaClient.listVo(dto);
    }

    @Override
    @GetMapping("/api/v1/news/one_vo/{id}")
    public ResponseResult OneVOById(Long id) {
        return iWemediaClient.OneVOById(id);
    }

    @Override
    @PostMapping("/api/v1/news/auth_fail")
    public ResponseResult authFail(NewsAuthDto dto) {
        return iWemediaClient.authFail(dto);
    }

    @Override
    @PostMapping("/api/v1/news/auth_pass")
    public ResponseResult authPass(NewsAuthDto dto) {
        return iWemediaClient.authPass(dto);
    }

    @Override
    @PostMapping("/api/v1/sensitive/list")
    public ResponseResult list(SensitiveDto dto) {
        return iWemediaClient.list(dto);
    }

    @Override
    @DeleteMapping("/api/v1/sensitive/del/{id}")
    public ResponseResult delete(Integer id) {
        return iWemediaClient.delete(id);
    }

    @Override
    @PostMapping("/api/v1/sensitive/save")
    public ResponseResult save(WmSensitive wmSensitive) {
        return iWemediaClient.save(wmSensitive);
    }

    @Override
    @PostMapping("/api/v1/sensitive/update")
    public ResponseResult update(WmSensitive wmSensitive) {
        return iWemediaClient.update(wmSensitive);
    }

    @Override
    @PostMapping("/api/insertwmuser")
    public ResponseResult insertwmuser(@RequestBody WmUser wmUser){
    return iWemediaClient.insertwmuser(wmUser);
    };


}

